﻿using System;

namespace Devonline.Core
{
    /// <summary>
    /// 对于将数据使用某种协议形式传输时的字段值格式转换描述
    /// </summary>
    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
    public class FieldAttribute : Attribute
    {
        /// <summary>
        /// 字段名
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 描述
        /// </summary>
        public string Doc { get; set; }
        /// <summary>
        /// 序号
        /// </summary>
        public int Index { get; set; }
        /// <summary>
        /// 数据类型
        /// </summary>
        public TypeCode Type { get; set; }
        /// <summary>
        /// 长度
        /// </summary>
        public int Size { get; set; }
        /// <summary>
        /// 主键列, 关键列
        /// </summary>
        public bool Keyable { get; set; }
        /// <summary>
        /// 是否可为空, 如果可为空, 使用默认值占位
        /// </summary>
        public bool Nullable { get; set; }
    }
}
